﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="${pageContext.request.contextPath}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<%@ include file="base.jsp" %>
<script src="${pageContext.request.contextPath}/js/jquery.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/base.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerGrid.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerForm.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerDateEditor.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerComboBox.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerCheckBox.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerRadio.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerSpinner.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerTextBox.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/inject.js" type="text/javascript"></script> 
<script src="${pageContext.request.contextPath}/js/ligerPopupEdit.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerDialog.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ligerTip.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.validate.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.metadata.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/messages_cn.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/common/ligerUiCommon.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/common/dateFormateUtil.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/common/ajax.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/js/ddgl.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function ()
	{
		addValidate(submitData);
		$("form").ligerForm();
	});
	
  //提交数据

	function submitData() {
		var url = "${pageContext.request.contextPath}/DdglAction?control=getDdSearchList";
		var postParams = [];
		if($("#ddh").val()) {
			postParams[postParams.length] = {
					name : 'ddh',
					value : $("#ddh").val()
				};
		} 
		
		if($("#khxm").val()) {
			postParams[postParams.length] =  {
					name : 'khxm',
					value : $("#khxm").val()
				};
		} 
		
		if($("#ddsjStar").val()) {
			postParams[postParams.length] = {
					name : 'ddsjStar',
					value : $("#ddsjStar").val()
				};
		} 
		
		if($("#ddsjEnd").val()) {
			postParams[postParams.length] = {
					name : 'ddsjEnd',
					value : $("#ddsjEnd").val()
				} ;
		} 
		
		
		f_initGrid(url, postParams);
	}

	//编辑数据
	function doEdit(f) {
		var row = manager.getSelectedRows();
		if (!row.length) {
			$.ligerDialog.warn("请选择一条数据！");
		} else if (row.length > 1) {
			$.ligerDialog.warn("只能选择一条数据进行编辑！");
		} else {
			f.href = "${pageContext.request.contextPath}/DdglAction?control=doEdit&jsonobj="
					+ encodeURIComponent(JSON.stringify(row[0]));
			f.click();
		}
	}

	//查看
	function doView(f) {
		var row = manager.getSelectedRows();
		if (!row.length) {
			$.ligerDialog.warn("请选择一条数据！");
		} else if (row.length > 1) {
			$.ligerDialog.warn("只能选择一条数据！");
		} else {
			f.href = "${pageContext.request.contextPath}/DdglAction?control=doView&jsonobj="
					+ encodeURIComponent(JSON.stringify(row[0]));
			f.click();
		}
	}

	//删除
	function doDelete() {
		var row = manager.getSelectedRows();
		if (!row.length) {
			$.ligerDialog.warn('请选择一条数据！');
		} else {
			$.ligerDialog
					.confirm(
							"当前选择了[<span style='color: red;'>" + row.length + "</span>]条数据! <P>请确认是否删除这些数据！",
							function(yes) {
								if (yes) {
									var url = "${pageContext.request.contextPath}/DdglAction?control=doDelete&id=";
									var id = "";
									for ( var i = 0; i < row.length; i++) {
										if (i == (row.length - 1)) {
											id += row[i].id;
										} else {
											id += row[i].id + "-";
										}

									}
									url += id;
									sendAjaxRequest(url, null, false, function(
											msg) {
										if (msg.data == "删除成功") {
											$.ligerDialog.success("删除成功");
											manager.reload();
										} else {
											$.ligerDialog.error(msg.data);
										}
									});
								}
							});
		}
	}

	//刷新页面
	function resetInput() {
		location.reload();
	}

	function showinfo(info_id) {
		$("#" + info_id + "_info").toggle();
		$("#" + info_id + "_show").toggle();
		$("#" + info_id + "_hidden").toggle();
	}
</script>
<title></title>
</head>
<style type="text/css">
body{background:#ffffff}
html{_overflow-y:scroll;}
</style>
<body style="overflow:hidden;padding:4px">
<table width="100%" align="center" cellpadding="0" cellspacing="0">
 <tr>
   <td>
      <table width="100%" align="center" cellpadding="0" cellspacing="0">
        <tr>
         <td class="add_l_t" valign="top">
           <form method="post" id="ddglForm">
            <table width="100%" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td>
                	   <table class="addd_lll" align="left" cellpadding="0" cellspacing="0">
                         <tr>
                            <td width="140" nowrap="nowrap" align="right">订单号：</td>
                            <td width="200" nowrap="nowrap" align="left"><input type="text" id="ddh" ltype="text"/></td>
                         </tr>
                       </table>
                       
                       <table class="addd_lll" align="left" cellpadding="0" cellspacing="0">
                         <tr>
                            <td width="140" nowrap="nowrap" align="right">客户姓名：</td>
                            <td width="200" nowrap="nowrap" align="left"><input type="text"  id="khxm"/></td>
                         </tr>
                       </table>
                       
                       <span id="show1_info">
                       <table class="addd_lll" align="left" cellpadding="0" cellspacing="0">
                         <tr>
                            <td width="140" nowrap="nowrap" align="right">订单时间(之后)：</td>
                            <td width="200" nowrap="nowrap" align="left"><input type="text" id="ddxjStar" ltype="date"/></td>
                         </tr>
                       </table>
                       <table class="addd_lll" align="left" cellpadding="0" cellspacing="0">
                         <tr>
                            <td width="140" nowrap="nowrap" align="right">订单时间(之前)：</td>
                            <td width="200" nowrap="nowrap" align="left"><input type="text" id="ddxjEnd" ltype="date"/></td>
                         </tr>
                       </table>
                       </span>
                      <table class="addd_lll" align="right" cellpadding="0" cellspacing="0">
                          <tr align="right" >
                            <td class="xxjbb_2" align="right" >
                              <ul>
                                <li class="xxjbb_1_block"><a href="#" onclick="submitData()">查询</a></li>
                                <li><a href="#" onclick="resetInput()">重置</a></li>
                              <!--  <li>
                                   <a href="#" onClick="showinfo('show1');" style="display:none" id="show1_hidden">隐藏</a>
                                   <a href="#" onClick="showinfo('show1');" style="display:none" id="show1_show">全部显示</a>
                                </li>
                                 --> 
                              </ul>
                            </td>
                          </tr>
                      </table>
                </td>
            </table>
           </form>
         </td>
       </tr>
      </table>
   </td>
 </tr>
 <tr><td height="10"></td></tr>
 <tr>
   <td class="xxjbb_1">
     <ul>
       <li class="xxjbb_1_block"><a href="ddgl_xz.jsp">新增</a></li>
       <li><a href="#" onclick="doEdit(this)">编辑</a></li>
       <li><a href="#" onclick="doDelete()">删除</a></li>
       <li><a href="#" onclick="doView(this)">查看</a></li>
     </ul>
   </td>
 </tr>
 <tr><td height="10"></td></tr>
 <tr>
   <td><div id="maingrid"></div></td>
 </tr>
</table>
</body>
</html>
